A technique has been known in which, per pixel or certain area in an input image, a depth value of the pixel or the certain area is estimated. An example of a depth value is a distance from an imaging apparatus to an object. However, in processing using such a technique, errors are caused in the depth estimation due to the feature of the image or noise which lowers the accuracy in detection, in some cases. Therefore, the image quality of the output image is degraded through the image processing using the depth values generated by the conventional depth estimation technique. For example, depth image based rendering (DIBR), in which a parallax image is generated by shifting the image based on the depth values, has a problem in that the generated image includes noise or distorted object caused by the errors in depth values. Furthermore, in processing for arbitrarily adjusting blurs in the image using the depth values, the anteroposterior relationship of the object cannot be maintained because of the depth value errors. The above problem causes another problem of unnatural blurs of the object in the generated image.
As described above, depth values with high-accuracy are required to improve the quality of the output image generated through imaging processing using depth values. However, as it has been described, there is a limit in the accuracy of the depth value estimation processing using an image and the estimated depth values include a lot of errors. In view of this, a technique for correcting the estimated depth values has been developed.
As a conventional depth value correction technique, a technique has been known in which depth values are corrected using a relationship between respective pixel values corresponding to a target pixel and a peripheral pixel (for example, see Patent Literature (PTL) 1). The apparatus disclosed in PTL 1 calculates a weight of a peripheral depth value using a pixel value (color, luminance, or chromaticity) of the input image, and corrects the depth value using the weight. In other words, the apparatus determines pixels having approximate pixel values as the same object and corrects the depth values of the pixels.